package Behavioral_design_pattern.Chain_Of_Responsibility_Pattern;

public class Client {
    public static void main(String[] args) {
        Leader director,manager,generalManager;
        director = new Director("张三");
        manager = new Manager("李四");
        generalManager = new GeneralManager("王五");

        //创建责任链
        director.setSuccessor(manager);
        manager.setSuccessor(generalManager);

        LeaveRequest lr1 = new LeaveRequest("小明",2);
        director.handleRequest(lr1);

        LeaveRequest lr2 = new LeaveRequest("小刚",5);
        director.handleRequest(lr2);

        LeaveRequest lr3 = new LeaveRequest("小红",15);
        director.handleRequest(lr3);

        LeaveRequest lr4 = new LeaveRequest("小美",40);
        director.handleRequest(lr4);
    }
}
